package com.vachel.editor.util;

import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.blankj.utilcode.util.ToastUtils;
import com.vachel.editor.R;


public class ToastUtil {

    private ToastUtil() {

    }

    public static void showToast(Context context, String msg) {
        View contentView = LayoutInflater.from(context).inflate(R.layout.toast_custom_view, null);
        ((TextView) contentView.findViewById(R.id.id_content)).setText(msg);
        ToastUtils.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
        ToastUtils.showCustomShort(contentView);
    }

    public static void showToast(Context context, int msg) {
        View contentView = LayoutInflater.from(context).inflate(R.layout.toast_custom_view, null);
        ((TextView) contentView.findViewById(R.id.id_content)).setText(msg + "");
        ToastUtils.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
        ToastUtils.showCustomShort(contentView);
    }


}
